<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
  <head>
    <title>后台管理系统</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!--Loading bootstrap css-->
    <link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/assets/vendors/font-awesome/css/font-awesome.min.css">
    <link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/assets/vendors/bootstrap/css/bootstrap.min.css">
    <!--Loading style-->
    <link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/assets/css/themes/style1/dazz-blueyellow.css" id="theme-change" class="style-change color-change">
    <link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/assets/background/css/background.css">
  </head>
<body class="sidebar-default header-fixed pace-done">
<div id="container" class="chargeBackground"><div id="output"></div></div>
    <div>
        <!--BEGIN BACK TO TOP--><a id="totop" href="#"><i class="fa fa-angle-up"></i></a>
        <!--END BACK TO TOP-->
        <!--BEGIN TOPBAR-->
        <div id="header-topbar-option-demo" class="page-header-topbar">
            <nav id="topbar" role="navigation" style="margin-bottom: 0; z-index: 2;" class="navbar navbar-default navbar-static-top">
                <div class="navbar-header">
                    <a id="logo" href="#" class="navbar-brand">
	                    <span class="fa fa-rocket"></span>
	                    <span class="logo-text">凝霜</span>
	                    <span style="display: none" class="logo-text-icon">
	                    	<img src="${pageContext.request.contextPath}/assets/images/ic-zhongduan.png" alt="" class="img-responsive " />&nbsp;
	                    </span>
                    </a>
                </div>
                <div class="topbar-main"><a id="menu-toggle" href="#" class="hidden-xs"><i class="fa fa-bars"></i></a>
                	<ul class="color">
						<li></li>
						<li></li>
						<li></li>
						<li></li>
						<li></li>
						<li></li>
						<li></li>
					</ul>
                    <ul class="nav navbar navbar-top-links navbar-right mbn" style="display: inline-flex;">
                    	<div id="headrightText" style="color:#fff;text-align:center;line-height:50px;margin-right:20px;float:left;display:block;">
         	  			</div>
                        <li class="dropdown topbar-user">
                            <a data-hover="dropdown" href="#" class="dropdown-toggle">
                            <c:if test="${sessionScope.userpath != null && sessionScope.userpath != ''}">
			                	<fmt:bundle basename="spring.config"> 
			                  		<img src="<fmt:message key='http.image.url' /><c:out value='${sessionScope.userpath}'/>" alt="" class="img-responsive img-circle" />&nbsp;
			                  	</fmt:bundle>
		                  	</c:if>
		                  	<c:if test="${sessionScope.userpath == '' || sessionScope.userpath == null}">
		                  		<img src="${pageContext.request.contextPath}/assets/images/AdministratorHead.jpg" alt="" class="img-responsive img-circle" />&nbsp;
		                  	</c:if>
                            <c:if test="${sessionScope.username == '超级管理员'}">
                            	<span class="hidden-xs">${sessionScope.username }</span>&nbsp;<span class="caret"></span>
                            </c:if>
                            <c:if test="${sessionScope.username != '超级管理员'}">
                            	<c:if test="${sessionScope.usertype != '2'}">
                            		<span class="hidden-xs">${sessionScope.organname }</span>&nbsp;<span class="caret"></span>
                            	</c:if>
                            	<c:if test="${sessionScope.usertype eq '2'}">
                            		<span class="hidden-xs">${sessionScope.account }</span>&nbsp;<span class="caret"></span>
                            	</c:if>
                            </c:if>
                            </a>
                            <ul class="dropdown-menu dropdown-user pull-right">
                                <li><a href="javascript:void(0);" id="edit-password"><i class="fa fa-edit" style="float:right"></i> 修 改 密 码</a>
                                </li>
                                <li><a href="${pageContext.request.contextPath}/login/logout"><i class="fa fa-key" style="float:right"></i> 注 销 登 录</a>
                                </li>
                            </ul>
                        </li>
                        <li class="dropdown hidden-xs">
                            <!--BEGIN THEME SETTING--><a id="theme-setting" href="javascript:;" data-hover="dropdown" data-step="1" data-intro="&lt;b&gt;Header&lt;/b&gt;, &lt;b&gt;sidebar&lt;/b&gt;, &lt;b&gt;border style&lt;/b&gt; and &lt;b&gt;color&lt;/b&gt;, all of them can change for you to create the best" data-position="left" class="dropdown-toggle"><i class="fa fa-cogs"></i></a>
                            <ul class="dropdown-menu dropdown-theme-setting pull-right">
                                <li>
                                    <h4 class="mtn">主题皮肤</h4>
                                    <ul id="list-color" class="list-unstyled list-inline">
                                        <li data-color="pink-blue" data-hover="tooltip" title="Pink - Blue" class="pink-blue"></li>
                                        <li data-color="pink-violet" data-hover="tooltip" title="Pink - Violet" class="pink-violet active"></li>
                                        <li data-color="orange-blue" data-hover="tooltip" title="Orange - Blue" class="orange-blue"></li>
                                        <li data-color="yellow-grey" data-hover="tooltip" title="Yellow - Grey" class="yellow-grey"></li>
                                        <li data-color="yellow-blue" data-hover="tooltip" title="Yellow - Blue" class="yellow-blue"></li>
                                        <li data-color="blue-dark" data-hover="tooltip" title="Blue - Dark" class="blue-dark"></li>
                                        <li data-color="yellow-green" data-hover="tooltip" title="Yellow - Green" class="yellow-green"></li>
                                        <li data-color="pink-brown" data-hover="tooltip" title="Pink - Brown" class="pink-brown"></li>
                                        <li data-color="red-black" data-hover="tooltip" title="Red - Black" class="red-black"></li>
                                        <li data-color="black-purple" data-hover="tooltip" title="Black - Purple" class="black-purple"></li>
                                        <li data-color="yellow-brown" data-hover="tooltip" title="Yellow - Brown" class="yellow-brown"></li>
                                        <li data-color="blue-black" data-hover="tooltip" title="Blue - Black" class="blue-black"></li>
                                        <li data-color="dazz-blue" data-hover="tooltip" title="dazz - blue" class="dazz-blue"></li>
										<li data-color="dazz-yellow" data-hover="tooltip" title="dazz - yellow" class="dazz-yellow"></li>
										<li data-color="dazz-pink" data-hover="tooltip" title="dazz - pink" class="dazz-pink"></li>
										<li data-color="dazz-gray" data-hover="tooltip" title="dazz - gray" class="dazz-gray"></li>
										<li data-color="dazz-grayblue" data-hover="tooltip" title="dazz - grayblue" class="dazz-grayblue"></li>
										<li data-color="dazz-green" data-hover="tooltip" title="dazz - green" class="dazz-green"></li>
										<li data-color="dazz-whitegray" data-hover="tooltip" title="dazz - whitegray" class="dazz-whitegray"></li>
										<li data-color="dazz-blueyellow" data-hover="tooltip" title="dazz - blueyellow" class="dazz-blueyellow"></li>
                                    </ul>
                                </li>
                            </ul>
                            <!--END THEME SETTING-->
                        </li>
                    </ul>
                </div>
            </nav>
        </div>
        <!--END TOPBAR-->
        <div id="wrapper" style="height:100%;margin-top:0px">
            <!--BEGIN SIDEBAR MENU-->
            <nav id="sidebar" role="navigation" class="navbar-default navbar-static-side" style="margin-top:50px">
                <div class="sidebar-collapse menu-scroll">
                    <ul id="side-menu" class="nav">
                        <li class="user-panel" style="padding:0px">
                        </li>
                        <li class="active"><a class="big-button" href="#" data-href="${pageContext.request.contextPath}/login/index"><i class="fa fa-bookmark"><div class="icon-bg bg-orange"></div></i><span class="menu-title">首页</span></a>
                        </li>
                        <!--li.charts-sum<div id="ajax-loaded-data-sidebar"></div>-->
                        <c:forEach items="${sessionScope.menu}" var="menu">
							<c:choose>
								<c:when test="${menu.menuId != '' && menu.menuId != null && menu.endFlag != 'yes'}">
									<li id="navigation${menu.menuId }">
										<a class="big-button" href="#"><i class="fa ${menu.iconPath} fa-fw"><div class="icon-bg bg-pink"></div></i><span class="menu-title">${menu.menuName}</span><span class="fa arrow"></span></a>
										<ul class="nav nav-second-level">
								</c:when>
								<c:when test="${menu.menuId != '' && menu.menuId != null && menu.endFlag == 'yes'}">
									<li><a class="big-button" href="#" data-href="${pageContext.request.contextPath}/${menu.dataHref}"><i class="fa ${menu.iconPath} fa-fw"><div class="icon-bg bg-orange"></div></i><span class="menu-title">${menu.menuName}</span></a>
									</li>
								</c:when>
								<c:when test="${menu.menuId == '' || menu.menuId == null && menu.endFlag != 'yes'}">
									<li><a class="small-button" href="#" data-href="${pageContext.request.contextPath}/${menu.dataHref}"><i class="fa ${menu.iconPath}"></i><span class="submenu-title">${menu.menuName }</span></a>
                                	</li>
								</c:when>
								<c:when test="${menu.menuId == '' || menu.menuId == null && menu.endFlag eq 'yes'}">
											<li><a class="small-button" href="#" data-href="${pageContext.request.contextPath}/${menu.dataHref}"><i class="fa ${menu.iconPath}"></i><span class="submenu-title">${menu.menuName }</span></a>
	                               			</li>
										</ul>
									</li>
								</c:when>
							</c:choose>
						</c:forEach>
                    </ul>
                </div>
            </nav>
            <!--END SIDEBAR MENU-->
            
            <!--BEGIN PAGE WRAPPER-->
            <div id="page-wrapper" style="height:100%">
                <!--BEGIN CONTENT-->
                <div class="page-content" style="height:100%; padding-bottom: 0px">
                	<iframe src="${pageContext.request.contextPath}/login/index" width=100% height=100% frameborder=0 scrolling=auto name="cotentframe" id="cotentframe"></iframe>
    			</div>
   				<!--END CONTENT-->
    		</div>
   			<!--BEGIN FOOTER-->
		    <div id="footer" style="height:30px;position:fixed;bottom:0">
		        <div class="copyright" style="text-align:center; margin-left: 200px">Copyright(C) 2017.All Rights Reserved Information Technology Co.,Ltd</div>
		    </div>
		    <!--END FOOTER-->
    	<!--END PAGE WRAPPER-->
    	</div>
    </div>
    <script src="${pageContext.request.contextPath}/assets/js/jquery-1.10.2.min.js"></script>
    <script src="${pageContext.request.contextPath}/assets/js/jquery-migrate-1.2.1.min.js"></script>
    <!--loading bootstrap js-->
    <script src="${pageContext.request.contextPath}/assets/vendors/bootstrap/js/bootstrap.min.js"></script>
    <script src="${pageContext.request.contextPath}/assets/vendors/bootstrap-hover-dropdown/bootstrap-hover-dropdown.js"></script>
    <script src="${pageContext.request.contextPath}/assets/vendors/metisMenu/jquery.metisMenu.js"></script>
    <script src="${pageContext.request.contextPath}/assets/vendors/slimScroll/jquery.slimscroll.js"></script>
    <script src="${pageContext.request.contextPath}/assets/vendors/jquery-cookie/jquery.cookie.js"></script>
    <script src="${pageContext.request.contextPath}/assets/vendors/iCheck/icheck.min.js"></script>
    <script src="${pageContext.request.contextPath}/assets/js/jquery.menu.js"></script>
    <!--CORE JAVASCRIPT-->
    <script src="${pageContext.request.contextPath}/assets/js/main.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/assets/js/base.js"></script>
    
    <script type="text/javascript">
    
    	window.onload = function() { 
    		var defaultColor = "dazz-blueyellow";
    	    var color = $.cookie('defaultThemeName');
    	    if (color==null || color=="") {
    	    	color = defaultColor;
    	    }
    	    $('#theme-change').attr('href', '../assets/css/themes/style1/' + color + '.css'); 
    	    
    	}
    
	 	// 点击修改密码
		var ctxt = "${pageContext.request.contextPath}";
		$('#edit-password').click(function() {
			$("#cotentframe").attr("src",ctxt + '/login/editPassword');
		});
		
		// 顶上时间显示
		var currentdate = getNowFormatDate();
		$("#headrightText").html(currentdate);
		setInterval("$('#headrightText').html(getNowFormatDate())",1000);
		
		function getNowFormatDate() {
		    var date = new Date();
		    var seperator1 = "/";
		    var seperator2 = ":";
		    var month = date.getMonth() + 1;
		    var strDate = date.getDate();
		    if (month >= 1 && month <= 9) {
		        month = "0" + month;
		    }
		    if (strDate >= 0 && strDate <= 9) {
		        strDate = "0" + strDate;
		    }
		    var week;
		    switch (date.getDay()){
		    case 1: week="星期一"; break;
		    case 2: week="星期二"; break;
		    case 3: week="星期三"; break;
		    case 4: week="星期四"; break;
		    case 5: week="星期五"; break;
		    case 6: week="星期六"; break;
		    default: week="星期天";
		    }
		    var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate
		            + "&nbsp&nbsp&nbsp" + week + "&nbsp&nbsp&nbsp" + format(date.getHours()) + seperator2 + format(date.getMinutes())
		            + seperator2 + format(date.getSeconds()) + "&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp;欢迎使用后台管理系统V0.0.1.001";
		    return currentdate;
		}
	    //接上面，该方法用于补充0的情况
	    function format (time){
	    	var a=(time+'').length;
		    return ('0'+time).substring(a-1);
	    }
	    
	 	// 小菜单点击
		$('.small-button').click(function() {
			var href = $(this).data('href');
			$(".nav li").removeClass("active");
			$(this).parent("li").addClass("active");
			$("#cotentframe").attr("src",href);
		});
		
		// 大菜单点击
		$('.big-button').click(function() {
			var href = $(this).data('href');
			
			if (href!=null && href!='' && href!='undefined') {
				$(".nav li").removeClass("active");
				$(this).parent("li").addClass("active");
				$("#cotentframe").attr("src",href);
			}
		});
    </script>
    
	<script src="${pageContext.request.contextPath}/assets/background/js/vector.js"></script>
	<script>
	
	$(function() {
		// 初始化 传入dom id
		var victor = new Victor("container", "output");
		
		var theme = [
						["#005453", "#00a4a2"],
						["#002c4a", "#005584"],
						["#35ac03", "#3f4303"],
						["#927663", "#4e3d32"],
						["#780179", "#650000"],
						["#c79111", "#6b4e0a"],
						["#5f5e5e", "#5f5e5e"]
					];
		
		$(".color li").each(function(index, val) {
			var color = theme[index];
			 $(this).click(function(){
			 	victor(color).set();
			 })
		});
		
		var defaultColor = "dazz-blueyellow";
	    var color = $.cookie('defaultThemeName');
	    if (color==null || color=="") {
	    	color = defaultColor;
	    }
		
		if (color == 'dazz-blueyellow') {
    		$('#container').css('display','block');
    		$('.color').css('display','block');
    	} else {
    		$('#container').css('display','none');
    		$('.color').css('display','none');
    	}
		
		if (window.screen.width <= 768) {
			$('body').addClass('sidebar-collapsed');
			$('.navbar-right').css('display', 'none');
		}
		
	});
	
	</script>
	</body>
</html>